{% extends 'base.html' %}
{% block title %}BabyLog 系统首页 {% endblock %}
{% block content %}
<main role="main">

  <!-- Main jumbotron for a primary marketing message or call to action -->
  <div class="jumbotron">
    <div class="container">
      <!-- <h1 class="display-4">
              <a href="{{ url_for('index') }}" class="text-success"><strong>BabyLog</strong></a>
              <small class="text-muted sub-title">记录点滴</small>
          </h1> -->
      {% for baby in babydata %}
      <!-- 暂时不输出多孩儿数据 -->
        {% if baby[5] == 1 %}
        <h3 class="text-success">Baby:{{ baby[0] }}</h3>
        <p>出生于:{{ baby[1] }}，年龄:{{ baby[2] }}，您的孩子已经出生{{ baby[3] }}天了。 系统中共有{{ baby[4] }}
          条关于{{ baby[0] }}的记录。</p>
        {% endif %}

      {% endfor %}
      <p><a class="btn btn-success btn-lg" href="{{ url_for('bloglist') }}" role="button">点击查看所有记录</a></p>
    </div>
  </div>





  <div class="card">
    <div class="card-header">
      那年今天>>>>
    </div>
    <div class="card-body">
      <blockquote class="blockquote mb-0">

        {% if oldblogs %}
        {% for blog in oldblogs %}
        <table class="table table-striped table-bordered table-hover">
          <tbody>
            <tr>
              <td><i class="fa fa-user fa-lg"></i> {{ blog.user.familymembers }}: 在<small data-toggle="tooltip" data-placement="top"
                  data-timestamp="{{ blog.create_time.strftime('%Y-%m-%dT%H:%M:%SZ') }}" data-delay="500">
                  {{ moment(blog.create_time).fromNow(refresh=True) }}
                </small>添加了1条数据</td>
            </tr>
            {% if blog.first %}
            <tr>
              <td><i class="fa fa-star fa-lg"></i> 第一次：{{  blog.first|safe }}</td>
            </tr>
            {% endif %}
            {% if blog.language %}
            <tr>
              <td><i class="fa fa-book fa-lg"></i> 语言：{{  blog.language |safe }}</td>
            </tr>
            {% endif %}
            {% if blog.cognitive %}
            <tr>
              <td><i class="fa fa-pencil-square-o fa-lg"></i> 认知：{{  blog.cognitive|safe  }}</td>
            </tr>
            {% endif %}
            {% if blog.blog %}
            <tr>
              <td>{{  blog.blog |safe }}
      
                {% if current_user.gm == 5 %}
                <a href="{{ url_for('updBlog',id = blog.id ) }}" target='blank'>编辑此条记录</a>
                {% endif %}
              </td>
            </tr>
            {% endif %}
      
      
          </tbody>
        </table>
      
        {% endfor %}
        {% else %}
        <table class="table table-striped table-bordered table-hover">
          <tbody>
            <tr>
              <td> <a href="{{  url_for('addBlog') }}" target="_blank" rel="noopener noreferrer">好巧，那年今天没有数据，不如添加一条新数据吧：）</a></td>
            </tr>
          </tbody>
        </table>
         
        {% endif %}






      </blockquote>
    </div>
  </div>





 
    <script type="text/javascript" src="{{ url_for('static', filename='js/echarts.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/home21.js') }}"></script>

    <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
    <div class="am-container" id="main" style="width:100%;height:400px;"></div>


  <hr>

  </div> <!-- /container -->

</main>
{% endblock  %}